﻿#region License
// /* **************************************************************
// * Copyright (C) intex Consulting GmbH - All Rights Reserved    *
// *--------------------------------------------------------------*
// * Unauthorized copying of this file, via any medium is         *
// * strictly prohibited                                          *
// *--------------------------------------------------------------*
// * Proprietary and confidential                                 *
// *--------------------------------------------------------------*
// * Dissasembling/modifications strictly prohibited!             *
// ***************************************************************/
#endregion

using ComHlp.enums;
using NLog;

namespace ComHlp.ContentClasses
{
    // ReSharper disable UnusedAutoPropertyAccessor.Global
    public class ItxFont
    {
        private static readonly Logger Log = LogManager.GetCurrentClassLogger();

        /// <summary> font family name to use </summary>
        public string Family { get; private set; }


        private readonly double _originalSize = 13;
        public double Size { get; private set; } = 12;

        /// <summary> font weight </summary>
        // ReSharper disable once MemberCanBePrivate.Global
        public ItxFontWeight Weight { get; private set; }


        /// <summary> default c'tor </summary>
        public ItxFont()
        {
            Family = "Segoe UI";
            Weight = ItxFontWeight.Regular;
        }

//        /// <summary> custom c'tor </summary>
//        /// <param name="fontFamily"></param>
//        /// <param name="fontWeight"></param>
//        public ItxFont(string fontFamily, string fontWeight)
//        {
//            // font family
//            Family = fontFamily;
            
//            /* 
//             * received font weight based on GetFontIdent logfont struct
//             * http://msdn.microsoft.com/en-us/library/dd145037%28v=vs.85%29.aspx
//             */
//            switch (fontWeight)
//            {
//                default:
//#if DEBUG
//                    Log.Debug($"Invalid font weight received: {fontWeight}");
//#endif
//                    break;
//                case "100": Weight = ItxFontWeight.Thin;
//                    break;
//                case "200": Weight = ItxFontWeight.UltraLight;//ExtraLight
//                    break;
//                case "300": Weight = ItxFontWeight.Light;
//                    break;
//                case "400": Weight = ItxFontWeight.Regular; //Normal
//                    break;
//                case "500": Weight = ItxFontWeight.Medium;
//                    break;
//                case "600": Weight = ItxFontWeight.SemiBold;//DemiBold
//                    break;
//                case "700": Weight = ItxFontWeight.Bold;
//                    break;
//                case "800": Weight = ItxFontWeight.UltraBold;//ExtraBold
//                    break;
//                case "900": Weight = ItxFontWeight.Heavy;//Black
//                    break;
//                case "950": Weight = ItxFontWeight.UltraBlack;//ExtraBlack
//                    break;
//            }
//        }

        public void UpdateFontWithFactor(double factor)
        {
            Size = _originalSize*(1*factor/100);
        }
    }
    // ReSharper restore UnusedAutoPropertyAccessor.Global
}
